import java.util.HashSet;
import java.util.Objects;

class Student {
    public String id;

    public Student(String id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(id, student.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}

public class HashTest {




    public int singleNumber(int[] nums) {
        HashSet<Integer> set = new HashSet<>();
        for (int i = 0; i < nums.length; i++) {
            if (!set.contains(nums[i])) {
                set.add(nums[i]);
            }else {
                set.remove(nums[i]);
            }
        }

        for (int i = 0; i < nums.length; i++) {
            if (set.contains(nums[i])) {
                return nums[i];
            }
        }

        return -1;
    }

    public static void main2(String[] args) {
        Student student = new Student("123");
        int hashCode = student.hashCode();
        System.out.println(hashCode);

        Student student1 = new Student("123");
        int hashCode1 = student1.hashCode();
        System.out.println(hashCode1);

        HashBuck2 hashBuck2 = new HashBuck2();
        hashBuck2.push(student,"hi");
        System.out.println(hashBuck2.get(student1));
    }


    public static void main1(String[] args) {
        HashBuck hashBuck = new HashBuck();
        hashBuck.push(2,99);
        hashBuck.push(13,99);
        hashBuck.push(5,99);
        hashBuck.push(7,99);
        hashBuck.push(5,99);
        hashBuck.push(8,99);
        hashBuck.push(16,99);
        hashBuck.push(9,99);

        System.out.println(hashBuck);
    }
}
